package com.lq.ecoldchain.ui.withdraw.mycard

import com.lq.ecoldchain.base.CommonLoadingViewModel
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2019/1/7 0007  16:46
*function by lq
*/
val mycardKodeinModule = Kodein.Module("MyCard_Kodein_Module"){
    bind<MyCardViewModel>() with scoped(AndroidLifecycleScope).singleton {
        MyCardViewModel()
    }

    bind<MyCardDelegate>() with scoped(AndroidLifecycleScope).singleton {
        MyCardDelegate(
                viewModel =  instance(),
                loadingViewModel =  CommonLoadingViewModel.instance(context)
        )
    }
}